package icu.ikuns.notice.element;

import icu.ikuns.notice.observe.MyObserver;

import java.util.ArrayList;

/**
 * @Author： Kimariyb
 * @Date：2022/05/26/18:14
 * @Description：
 */
public class Department extends MyElement implements MyObserver {
    private ArrayList list = new ArrayList();

    public void add(MyElement myElement) {
        list.add(myElement);
    }

    public void remove(MyElement myElement) {
        list.remove(myElement);
    }

    @Override
    public void send() {
        for (Object object : list) {
            ((MyElement) object).send();
        }
    }
}
